/*
 * @Author: 卡卡 1071780426@qq.com
 * @Date: 2023-08-11 16:15:02
 * @LastEditors: 卡卡 1071780426@qq.com
 * @LastEditTime: 2023-08-11 16:15:44
 * @FilePath: \zjgx\child\src\actions\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
function emptyAction() {
    // 设置一个actions实例
    // 提示当前使用的是空 Action
    console.warn('Current execute action is empty!');
}

class Actions {
    // 默认值为空 Action
    actions = {
        onGlobalStateChange: emptyAction,
        setGlobalState: emptyAction,
    };

    /**
     * 设置 actions
     */
    setActions(actions) {
        this.actions = actions;
    }

    /**
     * 映射
     */
    onGlobalStateChange(...args) {
        this.actions.onGlobalStateChange(...args);
        return;
    }

    /**
     * 映射
     */
    setGlobalState(...args) {
        this.actions.setGlobalState(...args);
        return;
    }
}

const actions = new Actions();
export default actions;